package com.miaosha.ms_03.util;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Pattern;

/**
 * @Description //TODO
 * @Author Administrator
 * @DATE 2020/9/16 22:48
 **/
public class ValidUtil {
    //手机号码校验
    private static final Pattern MOBILE_PATTERN = Pattern.compile("1\\d{10}");

    /**
     * @Description 判断是否是手机号码
     * @param mobile 手机号码
     **/
    public static Boolean isMobile(String mobile) {
        if (StringUtils.isEmpty(mobile)) {
            return false;
        }
        return MOBILE_PATTERN.matcher(mobile).matches();
    }
}
